package com.yazi.mxz.common.db.dao.impl;


import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.yazi.mxz.common.db.dao.SmsDao;
import com.yazi.mxz.common.entity.beans.Sms;
import com.myframework.smhj.hibernate.Searching;
import com.myframework.smhj.hibernate.Page;
import com.myframework.smhj.hibernate.dao.BasicDao;

@Repository("smsDao")
public class SmsDaoImpl extends BasicDao<Sms> implements SmsDao {


	public SmsDaoImpl() {
		super(Sms.class);
		
	}

	@Override
	public Page<Sms> listByGtAddtime(Sms sms, Searching si) {
		Long addTime = sms.getAddTime();
		sms.setAddTime(null);
		Criteria c = getExample(sms, si.getSearchWord());
		// 大于某个时间 
		if (null != addTime) {
			c.add(Restrictions.gt("addTime", addTime));
		}
		return list(c, si);
	}

}
